{% extends "./inc/base.html" %} 
{% block style %}
<link href="/static/admin/js/hswx/umeditor_utf8_php/themes/default/css/umeditor.css" type="text/css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/static/admin/js/hswx/css/hs_wx_base.css"/>
{% endblock %}
{% block content %}
<section class="vbox">
    <section id="bjax-target">
        <section class="hbox stretch">
            <!-- side content -->
            {% include "./inc/mp_side.html" %}
            <!-- / side content -->
            <section>
                <section class="vbox">
                    <header class="header bg-light b-b">
                        <p>{{controller.meta_title}}</p>
                    </header>
                    <section class="scrollable wrapper">
                        <!--陈金龙 start-->
                        <div class="hs-ui">
                            <!--box start-->
                            <div class="hs-fodder-box" id="hs-current-box">
                                <div class="hs-fodder-box-left">
                                    <div class="hs-fodder-finshed">
                                        <div class="hs-fodder-status-title">图文列表</div>
                                        <div class="hs-fodder-finshed-list">
                                            <div class="hs-fodder-items">
                                                <div class="hs-fodder-item active">
                                                    <div class="hs-fodder-item-first">
                                                        <div class="hs-fodder-item-container hs-item-cover">
                                                            <i class="hs-default-wxpic"></i>
                                                            <div class="hs-item-title-h4">标题</div>
                                                        </div>
                                                        <div class="hs-fodder-item-mask">
                                                            <a class="hs-igup" href="javascript:;" alt="上移">向上</a>
                                                            <a class="hs-igdp" href="javascript:;" alt="下移">向下</a>
                                                            <a class="hs-igdl" href="javascript:;" alt="删除">删除</a>
                                                        </div>
                                                    </div>
                                                    <div class="hs-fodder-item-second">
                                                        <div class="hs-fodder-item-container">
                                                            <div class="hs-fodder-item-rpic hs-item-cover">
                                                                <i class="hs-default-wxpic-2"></i>
                                                            </div>
                                                            <div class="hs-item-title-h4-2">标题</div>
                                                        </div>
                                                        <div class="hs-fodder-item-mask">
                                                            <a class="hs-igup" href="javascript:;" alt="上移">向上</a>
                                                            <a class="hs-igdp" href="javascript:;" alt="下移">向下</a>
                                                            <a class="hs-igdl" href="javascript:;" alt="删除">删除</a>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                            <a onclick="return false;" title="添加一篇图文" class="hs-fodder-add" href="javascript:void(0);">
                                                <i class="hs-icon35 hs-add-gray">增加一条</i>
                                            </a>
                                        </div>
                                    </div>
                                </div>
                                <div class="hs-fodder-box-right">c</div>
                                <div class="hs-fodder-box-middle">
                                    <!--<div class="hs-um-other">
                                        <input type="text" class="hs-um-title" placeholder="请在这里输入标题" />
                                        <input type="text" class="hs-um-author" placeholder="请输入作者" />
                                        <hr />
                                    </div>-->
                                    <!--style给定宽度可以影响编辑器的最终宽度-->
                                    <script type="text/plain" id="myEditor" style="width:100%!important;min-height:300px;">
                                        <p>这里我可以写一些输入提示</p>
                                    </script>
                                    
                                    <!--start-->
                                    <div class="hs-fodder-high-area">
                                        <div class="hs-high-title" style="padding: 30px 0 20px 0;">
                                            发布样式编辑
                                        </div>
                                        <div class="hs-high-img">
                                            <div class="hs-high-title">封面  <span class="hs-c-8d8d8d">大图片建议尺寸：900像素 * 500像素</span></div>
                                            <div class="hs-upload-wrap">
                                                <a class="hs-upload-btn" id="hsfilePicker" href="javascript:;">本地上传</a>
                                                <!--上传封面-->
                                                <!--用来存放item-->
                                                <div id="hsfileList" class="hs-uploader-list"></div>
                                            </div>
                                        </div>
                                        
                                        <div class="hs-high-imptxt">
                                            <div class="hs-high-title">摘要 <span class="hs-c-8d8d8d">选填，如果不填写会默认抓取正文前54个字</span></div>
                                            <div class="hs-high-txt">
                                                <textarea id="digest" class="hs-high-textare"></textarea>
                                            </div>
                                        </div>
                                        
                                        <div class="hs-source-url">
                                            <div class="hs-form-row">
                                                <label class="hs-form-label"><input type="checkbox" class="hs-checkbox hs-source-url-checkbox"/> 原文链接</label>
                                                <div class="hs-form-control">
                                                    <input type="text" class="hs-source-url-input hs-input" />
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!--end-->
                                </div>
                                
                            </div>
                            <!--box end-->
                        </div>
                        
                        <div class="clearfix" style="margin-top:20px">
                            <!--
                            <button class="btn" onclick="_hs_update_item_data({})">更新数据</button>
                            <button class="btn" onclick="_hs_query_item_data()">查看当前数据</button>    
                            <button class="btn" onclick="_hs_submit_articles()">保存</button>
                            -->
                            <button class="btn btn-primary btn-s-md" type="button" onclick="_hs_submit_articles()" style="margin-left:250px">确定保存</button>
                        </div>
                        <!--陈金龙 end-->
                    </section>
                </section>
            </section>
        </section>
    </section>

</section>
{% endblock %}

{% block script %}
<!--<script src="/static/admin/js/parsley/parsley.min.js"></script>
<script src="/static/admin/js/parsley/parsley.extend.js"></script>-->
<!--<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>-->
<script type="text/javascript" charset="utf-8" src="/static/admin/js/hswx/umeditor_utf8_php/umeditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/admin/js/hswx/umeditor_utf8_php/umeditor.js"></script>
<script type="text/javascript" src="/static/admin/js/hswx/umeditor_utf8_php/lang/zh-cn/zh-cn.js"></script>
<script src="/static/admin/js/hswx/js/webuploader.min.js"></script>
<script>
    var init_is_edit = "";
</script>
<script src="/static/admin/js/hswx/js/hs_fodder.js"></script>
<script>
    var init_data = {{data|safe}} || 0;
    if(init_data){
        init_is_edit = init_data.id;
        var material_content = JSON.parse(init_data.material_content);
        var arts = material_content.articles;
        $(".hs-fodder-items").html("");
        for(var i in arts){
            var art = arts[i];
            _hs_fodder_item((i==0?0:1), 1);
            var item = $('.hs-fodder-item:eq('+i+')');
            _hs_update_item_data(art, item);
            if(i == 0){
                _hs_wx_edit_fodder(art);
            }
        }
    }
</script>
{% endblock %}

